home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: uu4news.netcom.com!zodiac!szh
- From: szh@zcon.com (Syed Zaeem Hosain)
- Subject: Re: given: char foo[80]; there is no such thing as element foo[80] correct? (i.e. foo[80] = '\0' is beyond the array boundary)
- Message-ID: <1996Mar22.180530.27923@zcon.com>
- Sender: szh@zcon.com (Syed Zaeem Hosain)
- Nntp-Posting-Host: zodiac
- Reply-To: szh@zcon.com
- Organization: Z Consulting Group
- References: <4ithke$mql@hermes.acs.unt.edu>
- Date: Fri, 22 Mar 1996 18:05:30 GMT
-
- In article <4ithke$mql@hermes.acs.unt.edu>, johnw@jove.acs.unt.edu (John R. Williams) writes:
- >Syed Zaeem Hosain (szh@zcon.com) wrote:
- >> >// Yes. This works nice and safely for any array of known size.
- >> >foo[sizeof(foo)-1] = '\0';
- >
- >This is not safe even for strings if your character type is not
- >'char'. I know that sounds silly, but wchar_t *is* there for a reason,
- >y'know.
-
- Careful with your editing, please! I did *not* write the above.
-
- Z
-
-
- --
- -------------------------------------------------------------------------
- | Syed Zaeem Hosain P. O. Box 610097 (408) 441-7021 |
- | Z Consulting Group San Jose, CA 95161 szh@zcon.com |
- -------------------------------------------------------------------------
-